home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aar.d64
/
budget
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
10KB
|
308 lines
1 REM: BUDGET PROGRAM FOR C-64 AND MX-80 PRINTER.
2 REM: CHANGE LINES 65 AND 69 TO USE YOUR NAME IN TITLES.
3 REM: FOR DEPOSITS USE A '+' INSTEAD OF A CHEQUE NUMBER.
4 REM: USE '1EW' FOR BANK CASH MACHINE TRANSACTIONS.
5 REM: USE '1AD' FOR AUTOMATIC BANK DEBITS (IE AUTOMATIC MORTGAGE
6 REM: PAYMENTS.)
7 REM: CHANGE YEAR IN LINES 232 AND 5150
8 REM: PRG USES THE DYNAMIC KEYBOARD ROUTINE AND GROWS LONGER EACH
9 REM: YOU RUN IT. SO USE NEW DISK. ---------------------------------
10 GOSUB9700:PRINTCHR$(147):PR=0
15 POKE53280,15:POKE53281,15:PRINT"[151]"
50 IFFRE(0)>1000THEN64
60 PRINT"[147] W A R N I N G [146]":
61 PRINT" ROOM FOR ABOUT";INT(FRE(0))/50;" MORE ENTRIES[151]"
64 PRINT"[144] "
65 PRINT" YOUR BUDGET [146]":PRINT" ";
66 PRINT" [146][151]"
67 GETI$:IFI$=""THEN67
68 GOSUB69:GOTO70
69 PRINT"[144][147] YOUR BUDGET [146][151]":RETURN
70 PRINT" PROGRAM LAST RUN ON:";
71 Y1$=RIGHT$(Y$,2): PRINT" "P(28)"/"P(29)"/ "Y1$
80 PRINT" ENTER TODAYS'S DATE":INPUT" MONTH (MM/DD) ../..[157][157][157][157][157][157][157]";X$:
85 IFRIGHT$(X$,1)="."ORLEN(X$)<>5THEN87
86 GOTO90
87 PRINT"[145] RE-ENTER DATE - FORMAT (MM/DD)":FORI=1TO2500:NEXT
88 PRINT"[145][146][151] [145][145][145][145][145][145][145]":GOTO80
90 X=VAL(LEFT$(X$,2)):B=VAL(RIGHT$(X$,2)):P(28)=X:P(29)=B:
200 DATA 0, 0, 0, 0, 0
201 DATA 0, 0, 0, 0, 0
202 DATA 0, 0, 0, 0, 0
203 DATA 0, 0, 0, 0, 0
204 DATA 0, 0, 0, 0, 0
205 DATA 0, 0, 0, 0, 0, 0
232 DATA/86:REM CHANGE YEAR & LINE 5150
999 PRINTCHR$(147):F$=STR$(FRE(0)):IFLEN(F$)<5THENL=5-LEN(F$):FORR=1TOL:F$=" "+F$:NEXTR
1000 PRINT"[144][147] * * "F$" BYTES AVAILABLE * *[151]":LL=0
1010 PRINT" 1. ENTER CHECKS & CHARGES":
1020 PRINT" 2. PRINT CHECK REGISTER":
1030 PRINT" 3. PRINT CHARGE REGISTER":
1040 PRINT" 4. UPDATE BALANCE IN BUDGET CATEGORIES"
1050 PRINT" 5. CALCULATE SALES TAX":
1060 PRINT" 6. PRINT BALANCES IN ALL CATEGORIES":
1070 PRINT" 7. PERFORM SEARCH FOR CHARGE OR CHECK":
1080 PRINT" 8. EXAMINE AN INDIVIDUAL CATEGORY":
1090 PRINT" 9. STORE DATA AND END SESSION":
1140 PRINT:INPUT" ENTER NUMBER";WHICH
1155 ONWHICHGOSUB3000,4000,4000,2500,7000,2000,6000,4000,5000
1998 GOTO999
2000 REM PRINTS BALANCES IN ALL CATEGORIES
2020 PRINT"[144][147] BALANCES IN ALL CATEGORIES [151]":PRINT:
2030 RESTORE:FORI=1TO32:READZ9$:NEXT
2040 QQ=0:FORI=1TO26:READZ$:IFZ$="END"THEN2090
2041 N=P(ASC(Z$)-64):A$=STR$(N):Q=LEN(A$):FORL=QTO1STEP-1
2042 IFMID$(A$,L,1)<>"."THENNEXT:A$=A$+".00":GOTO2050
2043 IFL=Q-1THENA$=A$+"0"
2050 IFLEN(A$)<10THENL=10-LEN(A$):FORR=1TOL:A$=" "+A$:NEXTR
2053 PB$=STR$(P(27)):IFLEN(PB$)<10THENL=10-LEN(PB$):FORR=1TOL:PB$=" "+PB$:NEXTR
2055 IFPR=3THENOPEN4,4,0:GOSUB14005:GOSUB12000:GOTO2080
2070 PRINTLEFT$(Z$,10)TAB(25)" $"A$:QQ=QQ+1:IFQQ<>7THEN2080
2080 NEXTI
2090 P$=STR$(P(30)):Q=LEN(P$):FORL=QTO1STEP-1:IFMID$(P$,L,1)<>"."THENNEXT:P$=P$+".00"
2091 GOTO2093
2092 IFL=Q-1THENP$=P$+"0"
2093 IFLEN(P$)<10THENL=10-LEN(P$):FORR=1TOL:P$=" "+P$:NEXTR
2094 IFPR=3THENGOSUB13000:CLOSE4:RETURN
2100 PRINT" UNALLOCATED DEPOSITS"TAB(26)"$"P$
2120 PRINT" ACCT. BAL."TAB(26)"$"PB$
2450 GOSUB15000
2455 GETZ$:IFZ$=""THEN2455
2456 IFPEEK(197)=4THENPR=3:LI=0:GOSUB14000:GOTO2030:
2460 CLOSE4:RETURN
2500 REM SUBROUTINE TO UPDATE BALALNCES IN BUDGET CATEGORIES
2510 GOSUB69:PRINT" YOU CAN ADD OR SUBTRACT FROM ANY BUDGET CATEGORY."
2511 PRINT" HIT <[144]RETURN[146][151]> WHEN DONE.":PRINT
2515 PRINT"YOU HAVE $";P(30)" UNALLOCTAED DOLLARS"
2520 PRINT" WHICH BUDGET CATEGORY":INPUT" *[157][157][157]";T$:PRINT"[145] "
2521 W$=T$:GOSUB3200:W$=""
2525 IFT$="*"THENRETURN
2530 INPUT" ENTER AMOUNT ";X
2535 I=ASC(T$)-64:IFI<1ORI>26THENRETURN
2540 P(I)=P(I)+X:P(30)=P(30)-X:GOTO2510
3000 REM SUBROUTINE TO PUT IN DATA
3010 LINE=P(0)+10000+1:PRINTCHR$(147):GOSUB69
3022 PRINT" BALANCE = $";P(27):
3025 IFT$="N"THENPRINT" ** RE-ENTER DATA ** [146]":
3030 PRINT"ENTER CHECK NO. OR CREDIT CARD NAME OR <RETURN>[146] WHEN THROUGH.
3031 [133]" *CMDCMDCMD";N$:[139]N$[178]"*"[167]999
3032 [139]N$[178]"1EW"[167][153]"ON ELECTRONIC WITHDRAWL"
3033 [139]N$[178]"1AD"[167][153]"ON AUTOMATIC BANK DEBIT"
3034 [139]N$[178]"+"[167][153]"ON DEPOSIT"
3035 [139]N$[179][177]"+"[175]N$[179][177]"1EW"[175]N$[179][177]"1AD"[167][153]"ON CHEQUE NO. "N$" "
3040 N[178][198](N$):[133]" DATE (MM/DD) ";D$:
3041 [139][195](D$)[179][177]5[167][153]"ON RE-ENTER DATE - FORMAT (MM/DD)WAITPOKE":[137]3043
3042 [137]3044
3043 [129]I[178]1[164]2000:[130]:[153]"ON ONON":[137]3040
3044 [139]N$[178]"+"[167][153]" PAYEE ? DEPOSIT":D$[178]D$[170]Y$:I$[178]"DEPOSIT":[137]3061
3050 D$[178]D$[170]Y$:[133]" PAYEE ";I$:
3061 [133]" AMOUNT ";A$
3062 [139]N[179][177]43[167][133]" SALES TAX NCMDCMDCMD";Q$:[137]3070
3064 [139]N[178]43[167][133]" ALLOCATE DEPOSIT (Y/N) NWAITCMDCMDCMD";T$:
3066 [139]N[178]43[175]T$[178]"N"[167]I[178]30:[137]3074
3067 [153]"ON ON"
3070 [133]" CATEGORY ";W$:I[178][198](W$)[171]64:
3071 [139]I[179]1[176]I[177]26[167][153]"ON ILLEGAL CATEGORY";:[129]T[178]1[164]1500:[130]:[153]"CMDCMD ON"
3072 [139]I[179]1[176]I[177]26[167][153]"ON":[137]3070
3073 [141]3200
3074 [133]"STOP IS DATA OK (Y/N) YWAITCMDCMDCMDPOKE";T$
3075 [139]T$[178]"N"[167]3010
3076 [139]I[178]30[167]W$[178]" "
3080 P(0)[178]P(0)[170]1:X[178][197](A$):
3087 [139]N[178]43[167]X[178][171]X:Q$[178]"N"
3100 P(I)[178]P(I)[171]X
3110 [139]N[179]65[167]P(27)[178]P(27)[171]X
3120 [139]N[177]64[167]P(N[171]64)[178]P(N[171]64)[170]X
3121 [137]3400
3200 [139]W$[178]"A"[167][153][163]17)"ONAUTO "
3201 [139]W$[178]"B"[167][153][163]17)"ONBUSINESS "
3202 [139]W$[178]"C"[167][153][163]17)"ONCASH "
3203 [139]W$[178]"G"[167][153][163]17)"ONGENERAL "
3204 [139]W$[178]"H"[167][153][163]17)"ONHOUSEHOLD"
3205 [139]W$[178]"I"[167][153][163]17)"ONINSURANCE"
3206 [139]W$[178]"L"[167][153][163]17)"ONLEISURE "
3207 [139]W$[178]"M"[167][153][163]17)"ONMEDICAL "
3208 [139]W$[178]"U"[167][153][163]17)"ONUTILITIES"
3209 [142]
3300 [139]TT$[178]"A"[167]TT$[178]"AUTO"
3301 [139]TT$[178]"B"[167]TT$[178]"BUSINESS"
3302 [139]TT$[178]"C"[167]TT$[178]"CASH"
3303 [139]TT$[178]"G"[167]TT$[178]"GENERAL"
3304 [139]TT$[178]"H"[167]TT$[178]"HOUSEHOLD"
3305 [139]TT$[178]"I"[167]TT$[178]"INSURANCE"
3306 [139]TT$[178]"L"[167]TT$[178]"LEISURE"
3307 [139]TT$[178]"M"[167]TT$[178]"MEDICAL"
3308 [139]TT$[178]"U"[167]TT$[178]"UTILITIES"
3309 [142]
3400 [141]3500
3450 [137]3010
3500 [143] SUBROUTINE TO PUT DATA STATEMENTS IN PROGRAM
3510 OTHER$[178][196](LINE)[170] " DATA "[170]N$[170]C$[170]D$[170]C$[170]I$[170]C$[170]A$[170]C$[170]W$[170]C$[170]Q$
3515 O2$[178][196](LINE[170]1)[170]"DATA XXXX,X,X,X,X,X":
3520 RL[178]3530:[137]9600
3530 [141]9700:[137]3000
4000 [143] SUBROUTINE TO PRINT CHECK REGISTER, CHARGE REGISTER, OR A CATEGORY
4010 PR[178]0:[140]:B[178]0:[141]69
4011 [135]Z9$:[139]Z9$[179][177]"END"[167]4011
4012 [139]PR[178]2[167]4040
4020 [139]WHICH[178]8[167][133]" WHICH CATEGORY: ";TT$:W$[178]TT$:[141]3200:[141]3300:W$[178]""
4021 T$[178][200](TT$,1)
4025 [139]WHICH[178]3[167][133]" WHICH CHARGE CARD";T$:
4027 [133]" STARTING MONTH (MM)";M1:[133]" ENDING MONTH (MM) ";M2
4029 I[178]0:[153][199](147):[141]69
4040 [135]N$,D$,I$,A$,W$,Q$:
4041 [139]N$[178]"XXXX"[167]4064
4042 [139][197]([200](D$,2))[179]M1[167]4040
4043 [139][197]([200](D$,2))[177]M2[167]4040
4044 [139]WHICH[178]8[175]T$[179][177]W$[167]4040
4046 [139]WHICH[178]2[175][198](N$)[177]64[167]4040
4048 [139]WHICH[178]3[175][200](N$,1)[179][177][200](T$,1)[167]4040
4049 [139]PR[178]2[167]I[178]I[171]1:[159]4,4,0:[141]14005:[141]12000:[137]4060
4050 [153]" NUMBER: "N$:[153]" DATE: "D$:[153]" PAYEE: "I$:[153]" AMOUNT: "A$""
4054 [139][198](N$)[179][177]43[167]B[178]B[171]2[172][197](A$)
4055 B[178]B[170][197](A$):I[178]I[170]1:[139]I[179]4[167]4060
4056 [141]15000
4057 [161]Z9$:[139]Z9$[178]""[167]4057
4058 [139][194](197)[178]4[167]PR[178]2:LI[178]0:[141]14000:SS[178][197]([200](D$,2)):[140]:[137]4011
4059 [137]4029
4060 [137]4040
4064 [153]:[139]N$[178]"XXXX"[175]LI[177]0[175]PR[177]0[167][141]13000:[142]
4065 [139]WHICH[178]2[167][153]" "B$;" $"P(27)
4067 [139]WHICH[178]8[176]WHICH[178]3[167][153]" "B$;" $"P([198](T$)[171]64)
4068 B[178][181](B[172]100[170].5)[173]100:[153]" TOTAL = $";B
4070 [141]15000
4075 [161]Z9$:[139]Z9$[178]""[167]4075
4076 [139][194](197)[178]4[167]PR[178]2:LI[178]0:[141]14000:[140]:[141]4011
4080 [142]
5000 [143] SUBROUTINE TO PUT P ARRAY INTO DATA STATEMENTS
5010 RL[178]5020:[137]9600
5020 [141]9700:[141]69
5030 [153]"STOP TO SAVE PROGRAM AND DATA FOR NEXT SESSION:POKE"
5040 [153]" 1WAIT INSERT DISKETTE,"
5045 [153]" 2WAIT PRESS <STOPRETURNWAITPOKE> WHEN READY."
5047 [161]Z9$:[139]Z9$[178]""[167]5047
5048 [153]"LOAD"
5150 [148]"@0:64 EXPENSES-86",8:[143] OR WHATEVER NAME YOU WANT
5160 [158]64738
6000 [143] SUBROUTINE TO PERFORM SEARCH
6005 [141]69:[153]" ENTER CHARACTERS TO BE SEARCHED":[133]" ";SE$:[141]69:PR[178]0
6040 X[178][195](SE$)
6045 B[178]0:[140]:QQ[178]0:
6050 [135]Z9$:[139]Z9$[179][177]"END"[167]6050
6060 [135]N$,D$,I$,A$,W$,Q$
6065 [139]N$[178]"XXXX"[167]6125
6070 [139][200](I$,X)[179][177]SE$[167]6060
6080 [139]PR[178]2[167]I[178]I[171]1:[159]4,4,0:[141]14005:[141]12000:[137]6121
6115 [153]" NUMBER: "N$:[153]" DATE: "D$:[153]" PAYEE: "I$:[153]" AMOUNT: "A$
6117 B[178]B[170][197](A$):QQ[178]QQ[170]1:[139]QQ[179][177]4[167]6121
6118 QQ[178]0:[141]15000
6119 [161]A$:[139]A$[178]""[167]6119
6120 [141]69
6121 [137]6060
6125 [139]N$[178]"XXXX"[175]LI[177]0[175]PR[178]2[167][141]13000:[160]4:PR[178]0:[142]
6150 [153]:[153]" TOTAL FOR ABOVE = $"B
6200 [141]15000
6205 [161]Z9$:[139]Z9$[178]""[167]6205
6206 [139][194](197)[178]4[167]PR[178]2:LI[178]0:[141]14000:[137]6040
6210 [160]4:[142]
7000 [143] SUBROUTINE TO CALCULATE SALES TAX
7010 [141]69:[133]" ENTER SALES TAX RATE IN PERCENT";X:Z[178]X:X[178]X[173]100
7028 [153]"LOAD CALCULATING......":[153]" STOP PLEASE WAIT POKEWAIT"
7040 B[178]0:[140]
7050 [135]Z9$:[139]Z9$[179][177]"END"[167]7050
7060 [135]N$,D$,I$,A$,W$,Q$
7070 [139]Q$[179][177]"Y"[167]7090
7080 B[178]B[170][197](A$)
7090 [139]N$[179][177]"XXXX"[167]7060
7100 TAX[178](B[172]X):TAX[178][181](TAX[170].5):T$[178][196](TAX):
7101 T$[178]T$[170]".00":BB$[178][196](B)
7102 [139][195](T$)[179][195](BB$)[167]L[178][195](BB$)[171][195](T$):[129]R[178]1[164]L:T$[178]" "[170]T$:[130]
7105 Z$[178][196](Z):[139][195](Z$)[178]2[167]Z$[178]" "[170]Z$
7106 [139]PR[178]4[167][141]14000:[159]4,4,0:[152]4," TAXABLE PURCHASES = $ "BB$
7107 [139]PR[178]4[167][152]4," SALES TAX PAID (AT"Z$"%) = $ "T$ :[141]13105:[137]7130
7110 [141]69:[153]" TAXABLE PURCHASES $"BB$
7120 [153]:[153]:[153]" SALES TAX PAID $"T$
7130 [141]15000
7140 [161]Z9$:[139]Z9$[178]""[167]7140
7145 [139][194](197)[178]4[167]PR[178]4:[137]7040
7150 [142]
9000 [131] AUTO
9010 [131] BUSINESS
9020 [131] CASH
9030 [131] GENERAL
9040 [131] HOUSEHOLD
9050 [131] INSURANCE
9060 [131] LEISURE
9070 [131] MEDICAL
9080 [131] UTILITIES
9090 [131] END
9600 [143] SUBROUTINE TO PUT INFO INTO DATA STATEMENTS:
9605 LLL[178](LINE[171]10000)
9606 [153]"LOAD":[153]"PROCESSING DATA RECORD"LLL"NOW..."
9610 [153]"PRINT#":[129]I[178]0[164]5:[153]200[170]I;"DATA ";
9615 [129]J[178]0[164]4[171](I[178]5)
9617 A[178]P(I[172]5[170]J):A[178][181](A[172]1000[170].5)[173]1000:
9620 [153][202]([196](A),1);",";:[130]:[153][199](20):[130]:
9630 [153]OTHER$:[153]O2$:
9640 [153]"GOTO";RL:[153]""
9650 [143] DYNAMIC KEYBOARD
9660 [151]198,9
9670 [129]I[178]0[164]8:[151]631[170]I,13:[130]
9680 [128]
9700 S$[178]" "
9710 N$[178]S$:D$[178]S$:I$[178]S$:A$[178]S$:W$[178]S$:C$[178]",":Z$[178]S$:T$[178]S$:B$[178]"BALANCE =":Y$[178]S$
9720 SE$[178]S$:Q$[178]S$
9730 [134]P(30)
9740 [140]:[129]I[178]0[164]30:[135]P(I):[130]:[135]Y$
9750 [142]
12000 [139]LI[177]0[167]12051
12005 [152]4,[199](27)[199](68)[170][199](9)[170][199](15)[170][199](25)[170][199](36)[170][199](57);
12006 [152]4,[170][199](70)[170][199](0)
12010 [139]WHICH[178]2[167][152]4,[199](14)" CHECK REGISTER":[152]4,[199](20)
12015 [139]WHICH[178]3[167][152]4,[199](14)" CHARGE REGISTER":[152]4,[199](20)
12020 [139]WHICH[178]7[167][152]4,[199](14)" SEARCH LIST":[152]4,[199](20)
12025 [139]WHICH[178]8[167][152]4,[199](14)" "TT$" CATEGORY":[152]4,[199](20)
12030 [139]PR[178]3[167][152]4,[199](14)" BALANCES IN ALL CATEGORIES":
12031 [139]PR[178]3[167][152]4,[199](20):[152]4
12035 [139]PR[178]3[167]12050
12040 W$[178][201](Y$,2):
12041 [139]WHICH[179][177]7[167][152]4,[199](9)"FROM: "M1"/ "W$[199](9)" TO: "M2"/ "W$
12042 [139]WHICH[178]7[167][152]4,[199](9)"SEARCH FOR: "SE$
12043 [152]4
12045 [152]4,[199](9)"N0. CHEQUE"[199](9)" DATE"[199](9)" PAYEE"[199](9)" AMOUNT
12050 PRINT#4,CHR$(9)"-----------------------------------------------------------
12051 [139]PR[178]3[167][137]12110
12090 A1$[178]A$:Q[178][195](A1$):[129]L[178]Q[164]1[169][171]1
12091 [139][202](A1$,L,1)[179][177]"."[167][130]:A1$[178]A1$[170]".00":[137]12093
12092 [139]L[178]Q[171]1[167]A1$[178]A1$[170]"0"
12093 LE[178]8[171][195](A1$):[139][195](A$)[179]8[167][129]K[178]1[164]LE:A1$[178]" "[170]A1$:[130]K
12095 [139]PR[178]3[167]12110
12096 LL[178]LL[170]1:[139]LL[177]55[167]LL[178]0:[129]I[178]1[164]11:[152]4:[130]:[137]12000
12097 NN[178][197]([200](D$,2)):[139]NN[177]SS[167][152]4:SS[178]NN:LL[178]LL[170]1
12100 [139]N$[178]"+"[167]N$[178]"DEP"
12101 LI[178]LI[170]1:[152]4,[199](20)[199](9)LI[199](9)" "N$[199](9)D$[199](9)I$[199](9)"$"A1$:
12102 A[178][197](A$):[139]N$[178]"+"[167]D[178]A:A[178]A[171]A
12105 AT[178]AT[170]A:[160]4:[142]
12110 LI[178]LI[170]1:[152]4,[199](9)LI[199](9)Z$[199](9)[199](9)[199](9)"$"A$
12111 [160]4:[142]
13000 [139]WHICH[178]2[167]A2$[178][196](P(27))
13001 [139]WHICH[179][177]2[167]A2$[178][196](AT)
13003 [159]4,4,0:Q[178][195](A2$):[129]L[178]Q[164]1[169][171]1
13005 [139][202](A2$,L,1)[179][177]"."[167][130]:A2$[178]A2$[170]".00":[137]13015
13010 [139]L[178]Q[171]1[167]A2$[178]A2$[170]"0"
13015 LE[178]8[171][195](A2$):[139][195](A2$)[179]8[167][129]K[178]1[164]LE:A2$[178]" "[170]A2$:[130]K
13089 [139]WHICH[178]2[167][152]4
13090 [139]WHICH[178]2[167][152]4,[199](9)[199](9)[199](9)[199](9)"BALANCE ="[199](9)"$"A2$
13091 [139]WHICH[178]2[167][152]4
13092 [139]WHICH[178]2[167][152]4,[199](9)" (1AD=AUTOMATIC BANK DEBIT: 1EW=";
13093 [139]WHICH[178]2[167][152]4,"ELECTRONIC WITHDRAWAL)"
13095 [139]PR[178]3[167][152]4:[152]4,[199](9)" UNALLOCATED DEPOSITS ="[199](9)"$"P$
13096 [139]PR[178]3[167][152]4,[199](9)" ACCOUNT BALANCE ="[199](9)"$"PB$:[137]13105
13100 [139]WHICH[179][177]2[167][152]4:[152]4,[199](9)[199](9)[199](9);
13101 [139]WHICH[179][177]2[167][152]4,[199](9)"TOTAL ="[199](9)"$"A2$
13105 [129]I[178]1[164]4:[152]4:[130]:[152]4,[199](12):[160]4:PR[178]0:LI[178]0:AT[178]0:[142]
14000 [153]"LOAD PRINTING RECORD #":
14005 [153]""[163]25)LI[170]1:[142]
15000 [153]""
15001 [153]" <STOPRETURNWAITPOKE> TO CONTINUE OR <STOPF1WAITPOKE> TO PRINT";:[142]